<!DOCTYPE html>
<html>
  <head>
    <title>addServer</title>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
   <!--  <script type="text/javascript" src="http://yez_easy.gitee.io/zt_data_monitor/zt_data_monitor/webapp/js/util/FrameOption.js"></script> -->
   	<script type="text/javascript" src="../../js/util/FrameOption.js"></script>
   	<link rel="stylesheet" href="../../layui/css/layui.css" type="text/css"></link>
   	<link rel="stylesheet" href="../../css/util/page_head_main.css" type="text/css"></link>
   	
   	<script type="text/javascript" src="../../js/util/jquery.js"></script>
	<script type="text/javascript" src="../../layui/layui.all.js"></script>
	<script type="text/javascript" src="../../js/util/arttemplate.js"></script>
	<script type="text/javascript" src="../../js/util/page_head_main.js"></script>
	<script type="text/javascript" src="../../js/data/manager/province-data.js"></script>
  	<style type="text/css">
		.div-button-three{
			width: 300px;
			height: 30px;
			border-left: 0px;
			border-top: 0px;
			border-right: 0px;
			border-bottom: 0px;
			 width: 95%;
		}
		.span-svn{
			margin-left: 10px;
			 float: left;
			 width: 140px;
		}
		.div-button-one{
			  width: 100px;
		    height: 30px;
		    border-left: 0px;
		    border-top: 0px;
		    border-right: 0px;
		    border-bottom-color: #93D1FF;
		    text-align: center;
		}
		.div-button-four{
			width: 70px;
	    height: 35px;
	    border-left: 0px;
	    border-top: 0px;
	    border-right: 0px;
	    text-align: center;
	    background-color: #93D1FF;
	    border-bottom: 0px;
	    border-radius: 25px;
	    cursor: pointer;
			
		}
  	</style>
  </head>
  
  <body>
   <div style="width: 100%;float: left;">
		<div class="row-div-mian" id="headDiv"></div>
 	</div>
 	<div style="float: left;height: 730px;overflow: auto;width: 100%;">
 			<div style="float: left;margin-left: 30px; width: 98%;margin-top: 10px;">
 						<div class="layui-inline">
				      <label class="layui-form-label">条件：</label>
				      <div class="layui-input-inline">
				        <input type="text" value="2018-06-01" name="date" id="date" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input" lay-key="1">
				      </div>
				      <div class="layui-input-inline">
				       <input type="text" value="2018-08-01"  name="date1" id="date1" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input" lay-key="1">
				      </div>
				      <div class="layui-input-inline">
				      	<input value="0" name="" id="startVersion" class="div-button-one">
				      </div>
				      <div class="layui-input-inline">
				      	<input value="-1" name="" id="endVersion" class="div-button-one">
				      </div>
 						</div>
 					 	<div class="layui-inline">
 					 			<button class="div-button-four" onclick="seachSvnInfo()">搜索</button> 
 					 	</div>
     	</div>
     	<div style="float: left;overflow: auto; width: 98%;margin-left: 30px;overflow-x: auto;" id="showSycInfo">
     		
     		
     	</div>
     	<div id="svnFileContext" style="display: none;">
		 	 
		 </div>
 	</div>
 	 
     
  </body>
  <script type="text/html" id="templateHead">
			<span >
				 <a href="javascript:void(0)" onclick="clickServers()" style="color: #999!important;">svn日志</a>-
				 <a href="#" > <$=data$></a>
				 <a href="" style="margin-left: 5px;">
				  	<i class="layui-icon layui-anim layui-anim-rotate ">ဂ</i>
				 </a> 
			</span>
	</script>
	 <script type="text/html" id="templateSyc">
	 		  <div style=" margin-left: 30px;margin-top: 10px;width: 98%;">
	 		  	 <div style="width: 100%;margin-top: 10px;float: left;">
	 		  	 		<div style="width: 40px;float: left;"  >名字 </div>
	 		  	 		<div style="margin-left: 20px;width: 150px;float: left;"  >时间 </div>
	 		  	 		<div style="margin-left: 10px;width: 40px;float: left;"  > 版本</div>
	 		  	 		<div style="margin-left: 10px; float: left;"  >log</div>
	 		  	 </div>
	 		  	<$for(var i=0;i<data.length;i++){$>
	 		  	 <div style="width: 100%;margin-top: 40px;float: left;">
	 		  	 		<div style="width: 40px;float: left;"  ><$=data[i].author$> </div>
	 		  	 		<div style="margin-left: 20px;width: 150px;float: left;"  ><$=data[i].time$> </div>
	 		  	 		<div style="margin-left: 10px;width: 40px;float: left;"  > <$=data[i].myRevision$></div>
	 		  	 		<div style="margin-left: 10px; float: left;font-weight: 700;color: #5FB878;width: 80%;"  ><$=data[i].log$></div>
	 		  	 </div>
	 		  	 <div style="float: left;width: 90%;margin-top: 10px;margin-left: 30px;">
	 		  	 		<$for(var k=0;k<data[i].myChangedPaths.length;k++){$>
	 		  	 			  <div style="width: 100%;margin-top: 10px;float: left;">
				 		  	 		<div style="margin-left: 20px;width:30px;float: left;"  >
				 		  	 				<$if(data[i].myChangedPaths[k].status=="A"){$>
				 		  	 						<span style="color: #EB7350;">添加</span>
				 		  	 				<$}$>
				 		  	 			 <$if(data[i].myChangedPaths[k].status=="M"){$>
				 		  	 					<span style="color: #40AFFE;">修改</span>
				 		  	 				<$}$>
				 		  	 				<$if(data[i].myChangedPaths[k].status=="D"){$>
				 		  	 					<span style="color: lightslategray;font-weight: 700;">删除</span>
				 		  	 				<$}$>
				 		  	 		</div>
				 		  	 		<div style="margin-left: 40px;float: left;"  > 
				 		  	 			<a href="javascript:(0)" style="color: blue;" onclick="clickPathUrl('<$=data[i].myChangedPaths[k].newFileName$>')">
				 		  	 				<$if(pathUrl!=null&&data[i].myChangedPaths[k].newFileName==pathUrl){$>
				 		  	 					<span style="color: red;">
				 		  	 						<$=data[i].myChangedPaths[k].newFileName$>
				 		  	 					</span>
				 		  	 				<$}else{$>
				 		  	 						<$=data[i].myChangedPaths[k].newFileName$>
				 		  	 					<$}$>
				 		  	 			</a>
				 		  	 			<a href="javascript:(0)" style="color: blue;" onclick="queryFileContext('<$=data[i].myChangedPaths[k].newFileName$>')" >查看</a>
				 		  	 		</div>
				 		  	 </div>
	 		  	 		<$}$>
	 		  	 		<div style="float: left;width: 100%;margin-top: 10px;">
									<hr />	 		  	 			
	 		  	 		</div>
	 		  	 </div>
	 		  	 
	 		  	 <$}$>
	 		  	 	
	 		  </div>
	 </script>
	 <script type="text/html" id="templeteSvnFileContext">
	 		<$for(var i=0;i<data.length;i++){$>
	 				<div style="margin-left: 30px;">
	 					 <$=#data[i]$>
	 				</div>
	 		<$}$>
	 </script>
	<script type="text/javascript">
 		head({data:"命令"});	
 		 
 		function loads(){
 			loadSvnInfo();
 		}
 		 var ip="192.168.18.154";//"47.100.32.85"
 		 
 		var beginTime="2018-6-01";
 		var endTime="2018-08-31";
 		var startRevision=0;
 			var endRevision=-1;
 			var pathUrl="";
 		function loadSvnInfo(){
 			var url="http://"+ip+":8280/icy_sy_websit_manager/sVNController/queryListLog.icy?";
 			
 			var author="";
 			
 			 	 	$.getJSON(url+"beginTime="+beginTime+"&endTime="+endTime+"&author=&startRevision="+startRevision+"&endRevision="+endRevision+"&pathUrl="+pathUrl+"&icyCallback=?",function(data,sucess){
 			 	 		console.log(data,sucess)
 			 	 		var datas={
 			 	 			data:data.result,
 			 	 			pathUrl:data.pathUrl
 			 	 		};
 			 	 	 	var html = template('templateSyc', datas);
 						$("#showSycInfo").html(html);
 			 	 	
 			 	 });
 			}
 		
 		function seachSvnInfo(){
 			var startT= $("#date").val();
 			var endT=$("#date1").val();
 			var startVersion=$("#startVersion").val();
 			var endVersion=$("#endVersion").val();
 			console.log(endVersion)
 			if(startT!=null){
 					beginTime=startT;
 						if(endT!=null){
 							endTime=endT;
			 			if(startVersion!=null){
			 					startRevision=startVersion;
			 			}
			 			if(endVersion!=null){
			 					endRevision=endVersion;
			 			}
 						loadSvnInfo();
 				}
 			}
 		}
 		
 		function clickPathUrl(urla){
 			urla=urla.replace(/\//g,"~" );
 			if(urla!=""&&urla!=null){
 				pathUrl=urla;
 				loadSvnInfo();
 			}
 			
 			queryFileContext();
 			
 		}
  function queryFileContext(urla){
  	urla=urla.replace(/\//g,"~" );
  	var url="http://"+ip+":8280/icy_sy_websit_manager/sVNController/queryFileLog.icy?";
 			 	 	$.getJSON(url+"endRevision="+endRevision+"&pathUrl="+urla+"&icyCallback=?",function(data,sucess){
 			 	 		console.log(data,sucess)
 			 	 		var objectVal={
 			 	 			data:data.result
 			 	 		};
 			 	 		 var html1 = template('templeteSvnFileContext', objectVal);
		 				document.getElementById("svnFileContext").innerHTML = html1;
			 			layer.open({type:1,content:$('#svnFileContext').html(), area: ['70%', '70%'],title: ['接口测试', 'font-size:16px;']});
 			 	 });
  }
 		
 		
 		  loads();
	</script>
</html>
